package vn.info.vietnaminfo.utli;

import java.util.ArrayList;
import java.util.List;

import vn.info.vietnaminfo.R;
import vn.info.vietnaminfo.data.TTDiaDiem;
import android.content.Context;
import android.location.Location;
import android.telephony.TelephonyManager;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.RelativeLayout;

public class GlobalVariable
{	
	public static double LATITUDE 	= 0;
	public static double LONGITUDE 	= 0;
	public static Location LOCATION = null;
	
	public static int SCREEN_WIDTH 	= 0;
	public static int SCREEN_HEIGHT = 0;
	public static boolean GET_DATA_CHO_APP = false;
	
	public static float ANGLE = 0;
	public static float SCALE = 1;
	// Get Device ID
	public static String DEVICE_ID = "";	
	public static String getDeviceId(Context context)
	{
		TelephonyManager telephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
		return telephonyManager.getDeviceId();
	}
	
	public static String DanhSachLoaiHinhKinhDoanh = "";
	
	public static boolean onPauseRetailer = false;
	
	public static String[] VietnameseSigns = new String[] {

		"aAeEoOuUiIdDyY",

		"áàạảãâấầậẩẫăắằặẳẵ",

		"ÁÀẠẢÃÂẤẦẬẨẪĂẮẰẶẲẴ",

		"éèẹẻẽêếềệểễ",

		"ÉÈẸẺẼÊẾỀỆỂỄ",

		"óòọỏõôốồộổỗơớờợởỡ",

		"ÓÒỌỎÕÔỐỒỘỔỖƠỚỜỢỞỠ",

		"úùụủũưứừựửữ",

		"ÚÙỤỦŨƯỨỪỰỬỮ",

		"íìịỉĩ",

		"ÍÌỊỈĨ",

		"đ",

		"Đ",

		"ýỳỵỷỹ",

		"ÝỲỴỶỸ"

	};

	public static String RemoveSign4VietnameseString(String str)
	{
		// Tiến hành thay thế , lọc bỏ dấu cho chuỗi

		for (int i = 1; i < VietnameseSigns.length; i++) {
			for (int j = 0; j < VietnameseSigns[i].length(); j++) {
				str = str.replace(VietnameseSigns[i].charAt(j),
						VietnameseSigns[0].charAt(i - 1));
			}
		}
		return str;
	}
	
	public static void showAnimation(boolean isFirstTime,Context mContext,final int _position, View v,int getCount)
	{
		RelativeLayout rl = (RelativeLayout)v;
		if(isFirstTime){
			Animation an = AnimationUtils.loadAnimation(mContext, R.anim.slide_in_right);
			an.reset();
			rl.startAnimation(an);

			if(_position == getCount-1) isFirstTime =false;
		}
		else
		{
			if(_position == getCount-1){
				Animation an = AnimationUtils.loadAnimation(mContext, R.anim.slide_out_left);
				an.reset();
				rl.startAnimation(an);
			}

		}
	}

	public static void hideAnimation(boolean isFirstTime,Context mContext,final int _position,View v , int getCount )
	{
		RelativeLayout rl = (RelativeLayout)v;

		if(isFirstTime){
			Animation an = AnimationUtils.loadAnimation(mContext, R.anim.slide_in_left);
			an.reset();
			rl.startAnimation(an);

			if(_position == getCount-1) isFirstTime =false;
		}
		else
		{
			if(_position == getCount-1){
				Animation an = AnimationUtils.loadAnimation(mContext, R.anim.slide_out_right);
				an.reset();
				rl.startAnimation(an);
			}

		}
	}

	
}